import java.util.Scanner;

public class demo02 {
    //查找组成一个偶数最接近的两个素数
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        for (int i = n/2; i >0 ; i--) {
            int num=i;
            if(check(num)&&check(n-num)){
                System.out.println(i);
                System.out.println(n-i);
                break;
            }
        }
    }
    private static boolean check(int num){
        for (int j = 2; j < num; j++) {
            if(num%j==0){
                return false;
            }
        }
        return true;
    }
}
